package com.apes.scm.sal.saleOrder.repository;

import com.apes.framework.jpa.repository.CustomRepository;
import com.apes.scm.sal.saleOrder.model.SaleOrderCoupons;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface SaleOrderCouponsRepository  extends CustomRepository<SaleOrderCoupons, String> {

    @Modifying
    @Query("delete from SaleOrderCoupons a where a.couponsId in :couponsId and a.saleOrderItemId = :saleOrderItemId")
    void deleteAllByCouponsId(List<String> couponsId,String saleOrderItemId);
}
